package com.kongjs.application.init;

import com.kongjs.application.tenant.TenantRoleHierarchyInitializer;
import jakarta.annotation.Resource;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class ApplicationInitializer implements ApplicationRunner {

    @Resource
    private TenantRoleHierarchyInitializer tenantRoleHierarchyInitializer;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        tenantRoleHierarchyInitializer.initAllRoleHierarchy();
    }
}
